package com.smart.admin.controller;

import com.smart.admin.test.TestComponent;
import com.smart.admin.test.TestComponent1;
import com.smart.admin.utils.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author xiaoqiang
 * @Version TestController.java, v 0.1 2025年03月25日 16:35 xiaoqiang
 * @Description: TODO
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    private TestComponent testComponent;

    @Resource
    private TestComponent1 testComponent1;

    @GetMapping("/getNames")
    public Result<List<String>> getNames() {
        List<String> names = testComponent.getNames();
        for (String name : names) {
            System.out.println(name);
        }
        return Result.success(testComponent.getNames());
    }

    @GetMapping("/getTestListMap")
    public Result<Object> getTestListMap(){
        return Result.success(testComponent.getTestModelsMap());
    }
    @GetMapping("/getTestListMap1")
    public Result<Object> getTestListMap1(){
        return Result.success(testComponent1.getTestModelsMap());
    }
}
